#!/usr/bin/perl -w

use Net::Ping;
$p=Net::Ping->new;

if(@ARGV) {
	@H=(@ARGV);
} else {
	@H=qw(slack11s1 slack11s2 slack11s3 slack11s4);
}
@NH=();
for (@H) {
	if($p->ping($_,0.5)) {
		push @NH,$_;
	}
}
@H=@NH;

%D=(	"/home/venture/projects/SOURCE/linuxha2/bin" => "/opt/lha2/bin",
	"/home/venture/projects/SOURCE/linuxha2/lib" => "/opt/lha2/lib",
	"/home/venture/projects/SOURCE/linuxha2/lib/storage_spec" => "/opt/lha2/lib/storage_spec",
	"/home/venture/projects/SOURCE/linuxha2/clreqd_modules" => "/opt/lha2/clreqd_modules",
	"/home/venture/projects/SOURCE/linuxha2/dbtools" => "/opt/lha2/dbtools",
	"/home/venture/projects/SOURCE/linuxha2/doc" => "/opt/lha2/doc",
	"/home/venture/projects/SOURCE/linuxha2/tests" => "/opt/lha2/tests",
	"/home/venture/projects/SOURCE/linuxha2/utils" => "/opt/lha2/utils",
	"/home/venture/projects/SOURCE/linuxha2/setup" => "/opt/lha2/setup",
);

for $h (@H) {
	for $d (keys %D) {
		chdir $d || die;
		system("scp * root\@$h:$D{$d}");
	}
}
